package com.mukefile.service.impl;

import com.mukefile.dao.SysProfileDao;
import com.mukefile.pojo.ResponseData;
import com.mukefile.pojo.SysProfile;
import com.mukefile.service.SysProfileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author xinke.huang@hand-china.com
 * @version 1.0
 * @date 2021/2/5
 */
@Service("SysProfileService")
@Transactional(rollbackFor = Exception.class)
public class SysProfileServiceImpl implements SysProfileService {
    @Autowired
    SysProfileDao sysProfileDao;
    @Override
    public int addSysProfile(SysProfile sysProfile) {
        return this.sysProfileDao.insertSysProfile(sysProfile);
    }

    @Override
    public int editSysProfile(SysProfile sysProfile) {
        return this.sysProfileDao.updateSysProfile(sysProfile);
    }

    @Override
    public int batchDeleteSysProfile(List<SysProfile> list) {
        return this.sysProfileDao.batchDeleteSysProfile(list);
    }

    @Override
    public String getSysProfileValue(String profileName) {
        return this.sysProfileDao.querySysProfileByName(profileName);
    }

    @Override
    public ResponseData<SysProfile> querySysProfile(int page, int limit) {
        return this.sysProfileDao.selectProfile(page,limit);
    }
}
